var timerButton = document.getElementById('timer');
var messageButton = document.getElementById('message');
var counter = 1;
// () => void
// function () {}
//
// (x: number) => boolean
// function (x: number): boolean {}
function changeTimerButton(cb) {
    setTimeout(function () {
        timerButton.innerHTML = String(counter);
        counter++;
        cb();
    }, 1000);
}
changeTimerButton(function () {
    changeTimerButton(function () {
        changeTimerButton(function () {
            changeTimerButton(function () {
                changeTimerButton(function () {
                    changeTimerButton(function () {
                        messageButton.innerHTML = 'Change finished';
                    });
                });
            });
        });
    });
});
